package com.horse.cloud.framework.redis;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.data.redis.connection.Message;
import org.springframework.data.redis.connection.MessageListener;
import org.springframework.stereotype.Component;


/**
 * @create: Created by intelliJIDEA18.1.3
 * @author: bing.Pan
 * @e-mail: 15923508369@163.com
 * @gmdate: 23/07/2018 14:27 星期一
 * @sidesc: redis 订阅服务
 */

@Component
public class TopicMessageListener implements MessageListener {

    private static final Logger LOGGER = LoggerFactory.getLogger(TopicMessageListener.class);

    @Override
    public void onMessage(Message message, byte[] pattern) {
        LOGGER.info("【framework-redis】 redis订阅消息接收到的通道名称为 [{}],信息为 [{}]",new String(message.getChannel()),new String(message.getBody()));

    }



}
